package com.nstc.demo.dao;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import com.nstc.demo.dto.AimsAccountInfo;
import com.nstc.demo.dto.AimsAccountQueryParam;
import com.nstc.demo.entity.AimsAccount;

@Component
public interface AimsAccountMapper {
	/**
	 * 
	 * @Title: deleteByPrimaryKey
	 * @Description: 根据主键删除
	 * @param accountid
	 * @return
	 * @throws
	 */
	int deleteByPrimaryKey(int accountid);

	/**
	 * 
	 * @Title: insertSelective
	 * @Description: 新增
	 * @param record
	 * @return
	 * @throws
	 */
	int insert(AimsAccount record);

	/**
	 * 
	 * @Title: insertSelective
	 * @Description: 新增，字段为空忽略
	 * @param record
	 * @return
	 * @throws
	 */
	int insertSelective(AimsAccount record);

	/**
	 * 
	 * @Title: selectByPrimaryKey
	 * @Description: 根据主键查询
	 * @param accountid
	 * @return
	 * @throws
	 */
	AimsAccount selectByPrimaryKey(int accountid);

	/**
	 * 
	 * @Title: selectByPrimaryKey
	 * @Description: 根据主键查询开户登记详情信息,附带合作金融网点字段
	 * @param accountid
	 * @return
	 * @throws
	 */
	@Select("select ACC.*,ASS.ASSOCIATEBANKNAME as associatebankname from AIMS_ACCOUNT acc left join AIMS_ASSOCIATEBANK ass on acc.ASSID=ASS.ASSID where accountid=#{accountid}")
	AimsAccountInfo getInfoById(@Param("accountid") int accountid);

	/**
	 * 
	 * @Title: updateByPrimaryKeySelective
	 * @Description: 根据实体主键更新实体，未传入的字段保持原样
	 * @param record
	 * @return
	 * @throws
	 */
	int updateByPrimaryKeySelective(AimsAccount record);

	/**
	 * 
	 * @Title: updateByPrimaryKey
	 * @Description: 根据实体主键更新实体
	 * @param record
	 * @return
	 * @throws
	 */
	int updateByPrimaryKey(AimsAccount record);

	/**
	 * 
	 * @Title: getListWithCondition
	 * @Description: 根据条件查询
	 * @param account
	 * @return
	 * @throws
	 */
	List<AimsAccount> getListWithCondition(@Param("account") AimsAccountQueryParam account);
}